package com.apes.auto.car.service;

import com.apes.auto.car.model.AutoCategory;
import com.apes.auto.car.repository.AutoCategoryRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName AutoCategoryService
 * @Description TODO
 * @Author pengyb
 * @Date 2019/7/12 11:33
 * @Version 1.0
 **/
@Service("autoCategoryService")
public class AutoCategoryService extends DomainService {
    @Autowired
    private AutoCategoryRepository autoCategoryRepository;

    private AutoCategory save(SimpleRequest request) {
        AutoCategory o = request.getO(AutoCategory.class);
        return autoCategoryRepository.save(o);
    }

    private String delete(SimpleRequest request) {
        AutoCategory o = request.getO(AutoCategory.class);
        autoCategoryRepository.delete(o);
        return "删除成功";
    }
}
